Image processing apparatus and method of controlling the same and recording medium

ABSTRACT

An apparatus captures an image of a measuring instrument that is captured by an imaging apparatus, sets an area in the image as an edge detection processing target in response to a user operation, and executes edge detection processing on the set area in the image. Further, the image processing apparatus sets a value for correcting a position of a detected edge portion. The image processing apparatus corrects the position of the detected edge portion based on the set value and calculates a value indicated by a pointer of the measuring instrument according to the corrected position of the edge portion.

BACKGROUND OF THE INVENTION Field of the Invention

The aspect of the embodiment relates to an image processing apparatusfor processing a captured image of a measuring instrument and reading avalue indicated by a pointer of the measuring instrument, a method ofcontrolling the measuring instrument, and a recording medium.

Description of the Related Art

Conventionally, a technique is used in which an imaging apparatuscaptures an image of an analogmeter configured to measure a physicalquantity, such as a temperature, a pressure, the number of rotations, acurrent, or a voltage, and the captured image is analyzed to output thevalue indicated by a pointer needle of the analogmeter (discussed inJapanese Patent Application Laid-Open No. 2004-133560).

The technique discussed in Japanese Patent Application Laid-Open No.2004-133560 does not consider the shape of the pointer needle, and thereare cases in which erroneous edge detection occurs due to the thickness,pattern, etc. of the pointer needle to make it difficult to obtain acorrect measurement value.

SUMMARY OF THE INVENTION

According to an aspect of the embodiments, an image processing apparatusincludes an acquisition unit configured to acquire an image of ameasuring instrument that is captured by an imaging apparatus, a firstsetting unit configured to set an area in the image as an edge detectionprocessing target in response to a user operation, a detection unitconfigured to execute edge detection processing on the set area in theimage, a second setting unit configured to set a value for correcting aposition of a detected edge portion, a correction unit configured tocorrect the position of the detected edge portion based on the value,and a calculation unit configured to calculate a value indicated by apointer of the measuring instrument according to the corrected positionof the edge portion.

Further features of the disclosure will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example of a configuration of an entire systemaccording to an exemplary embodiment of the disclosure.

FIG. 2 is a flowchart illustrating an example of operations of an imageprocessing apparatus in a setting mode according to an exemplaryembodiment of the disclosure.

FIG. 3 is a flowchart illustrating an example of operations of the imageprocessing apparatus in the setting mode according to an exemplaryembodiment of the disclosure.

FIG. 4 illustrates an example of an analogmeter setting screen accordingto an exemplary embodiment of the disclosure.

FIG. 5 illustrates an example of the analogmeter setting screenaccording to an exemplary embodiment of the disclosure.

FIG. 6 illustrates an example of the analogmeter setting screenaccording to an exemplary embodiment of the disclosure.

FIG. 7 illustrates an example of the analogmeter setting screenaccording to an exemplary embodiment of the disclosure.

FIG. 8 is a flowchart illustrating an example of operations of an imageprocessing apparatus in an operation mode according to an exemplaryembodiment of the disclosure.

FIG. 9 is a conceptual diagram illustrating an analogmeter according toan exemplary embodiment of the disclosure.

FIG. 10 illustrates an example of the analogmeter setting screenaccording to an exemplary embodiment of the disclosure.

FIG. 11 is a flowchart illustrating an example of operations of an imageprocessing apparatus in the setting mode according to an exemplaryembodiment of the disclosure.

FIG. 12 is a flowchart illustrating an example of operations of an imageprocessing apparatus in the setting mode according to an exemplaryembodiment of the disclosure.

FIG. 13 illustrates an example of the analogmeter setting screenaccording to an exemplary embodiment of the disclosure.

FIG. 14 is a flowchart illustrating an example of operations of an imageprocessing apparatus in the operation mode according to an exemplaryembodiment of the disclosure.

FIG. 15 is a conceptual diagram illustrating an analogmeter according toan exemplary embodiment of the disclosure.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments of the disclosure will be described indetail below with reference to the drawings. It should be noted that thecomponents described in the exemplary embodiments are mere examples andare not intended to limit the scope of the invention.

In an exemplary embodiment of the disclosure, an image processingapparatus will be described below that reads a measurement valueaccording to a pointer of a circular analogmeter (round measuringinstrument) that specifies a physical quantity such as a temperature, apressure, the number of rotations, a current, or a voltage.

<System Configuration>

FIG. 1 illustrates a configuration of an entire system including animage processing apparatus 100 according to the present exemplaryembodiment. In FIG. 1, the image processing apparatus 100 is implementedby a computer apparatus and executes a predetermined control program toperform image processing described below. A control unit 101 controlsthe entire image processing apparatus 100 and is implemented by, forexample, a central processing unit (CPU). A read-only memory (ROM) 102stores operation processing procedures (e.g., a program for computeractivation processing, basic input/output processing, etc.) of thecontrol unit 101. A random access memory (RAM) 103 functions as a mainmemory of the control unit 101. Various programs including a controlprogram for realizing a process described below are loaded onto the RAM103 from a hard disk drive (HDD) 105, etc. and executed by the controlunit 101. Further, the RAM 103 provides a work area when the controlunit 101 executes various types of processing. A display 104 performsvarious types of displaying under the control by the control unit 101.The HDD 105 is used to save and read application programs, data,libraries, etc. An input device 106 is implemented by a pointing device,a keyboard, etc. and used for data input according to user operations. Astorage medium mounting unit (medium drive) 107 enables mounting aremovable storage medium and reading data captured and stored in thestorage medium by an imaging apparatus 112. A network interface 108 isconnected to a network 111 via a communication line 110. Data istransmitted and received to and from an external device that iscommunicable via the network interface 108. In the present exemplaryembodiment, the image processing apparatus 100 is connected with theimaging apparatus 112 via the network interface 108, and the controlunit 101 transmits an image capturing instruction to the imagingapparatus 112. A captured image is acquired by the control unit 101, andrecorded in the HDD 105. A system bus 109 connects the above-describedunits and is composed of an address bus, a data bus, and a control bus.

The imaging apparatus 112 acquires image data by capturing an image ofan object, and is implemented by an electronic device having an imagingunit, such as a digital still camera, a digital movie camera, or amonitoring camera. The imaging apparatus 112 is connected to the network111 via a communication circuit 113 to be communicable with the imageprocessing apparatus 100. An analogmeter 114 measures a physicalquantity of, for example, temperature, pressure, number of rotations,current, and voltage, and specifies a measurement value with a pointer.

The image processing apparatus 100 in the present exemplary embodimentoperates in two modes, a setting mode and an operation mode, to realizethe reading of the measurement value of the analogmeter 114. In thesetting mode, various types of information are preset to realize thereading of the measurement value of the analogmeter 114 according to animage of the analogmeter 114 that is captured by the imaging apparatus112. On the other hand, in the operation mode, image data of theanalogmeter 114 captured by the imaging apparatus 112 is analyzed, andthe measurement value of the analogmeter 114 is calculated based on thevarious types of information set in the setting mode.

In the present exemplary embodiment, the image to be processed is anon-compressed or decompressed 8-bit depth gray-scale image. Thus, theimaging apparatus 112 converts the image data acquired by capturing animage of the analogmeter 114 into gray-scale image data, and transmitsthe converted gray-scale image data to the image processing apparatus100 via the network 111. Alternatively, the imaging apparatus 112 maytransmit original image data to the image processing apparatus 100 andthe image processing apparatus 100 may convert the image data intogray-scale image data. The image processing apparatus 100 stores thegray-scale image data, a processing target in the present exemplaryembodiment, in the HDD 105.

<Processing in Setting Mode>

A Process in the setting mode performed in the image processingapparatus 100 in the present exemplary embodiment will be describedbelow with reference to the drawings.

The control unit 101 of the image processing apparatus 100 reads andstarts an application program for executing analogmeter readingprocessing from the HDD 105. The control unit 101 executes operationsdescribed below according to an operating system (OS) and theapplication program.

When the application program is activated, the control unit 101 performsdisplay control to display a menu screen on the display 104, and selectsone of the setting mode or the operation mode according to a useroperation.

The operations of the image processing apparatus 100 in the case wherethe setting mode is selected will be described below with reference tothe flowcharts illustrated in FIGS. 2 and 3.

In step S201, the control unit 101 determine whether an instruction toacquire a captured image of the analogmeter 114 is input. If the settingmode is selected on the menu screen described above, the control unit101 displays an analogmeter setting screen 400 as illustrated in FIG. 4on the display 104. A capture image button 402 is an area forinstructing the imaging apparatus 112 to capture an image, storing acaptured image in the HDD 105, and receiving an instruction to read thecaptured image from the HDD 105. A read image button 403 is an area forreceiving an instruction to read an image already stored in the HDD 105.If the control unit 101 detects a user operation on the capture imagebutton 402 or the read image button 403, the control unit 101 determinesthat an instruction from the user to acquire an image is input. If thecontrol unit 101 receives a user operation on the capture image button402 (YES in step S201), the control unit 101 transmits an imagecapturing instruction to the imaging apparatus 112 via the networkinterface 108. If the imaging apparatus 112 receives the image capturinginstruction from the image processing apparatus 100, the imagingapparatus 112 performs image capturing processing on the analogmeter 114as an object to generate image data, and transmits the generated imagedata to the image processing apparatus 100. In step S202, the imageprocessing apparatus 100 acquires the image data from the imagingapparatus 112 via the network interface 108, stores the image data inthe HDD 105, and reads the image data from the HDD 105 and writes theimage data into the RAM 103. On the other hand, if the control unit 101receives a user operation on the read image button 403 (YES in stepS201), the control unit 101 displays a file-open dialog. Then, in stepS202, the control unit 101 reads the image data from the HDD 105selected by the user on the file-open dialog and writes the image datainto the RAM 103.

In step S203, the control unit 101 displays image data 501 read from theHDD 105 to the RAM 103 in an image display area 401, as illustrated inFIG. 5.

In step S204, if the control unit 101 receives a press operation on adesignate area button 612 for designating an edge detection area, thecontrol unit 101 draws and displays a geometric shape for edge detectionarea designation, and determines whether a user operation to designate acentral point of the edge detection area is received. For example, if aleft-click operation of the pointing device (the input device 106) isperformed on the image data 501 displayed in the image display area 401(YES in step S204), then in step S205, the control unit 101 stores thecoordinates of the position as the coordinates of the central point ofthe edge detection area in the RAM 103. FIG. 6 illustrates a centralpoint 620. On the image data 501, the origin of the coordinates islocated at the upper left, and the X-coordinate increases rightwardwhereas the Y-coordinate increases downward.

In step S206, the control unit 101 draws an outer-circle arc 621 on theimage data 501 such that the center of the outer-circle arc 621 islocated at the central point 620 and the distance from the central point620 to the position at which a cursor 629 is located is the radius ofthe outer-circle arc 621, as illustrated in FIG. 6. As the user operatesthe pointing device to move the cursor 629 on the outer-circle arc 621so that the distance from the central point 620 to the cursor 629 ischanged, the radius of the outer-circle arc 621 is changed, and thecontrol unit 101 re-draws the outer-circle arc 621. In step S207, thecontrol unit 101 determines whether a user operation to designate theradius of the outer circle is received. For example, if a left-clickoperation is performed while the cursor 629 is on the outer-circle arc621 (YES in step S207), then in step S208, the control unit 101 storesthe distance from the position of the cursor 629 to the central point620 as the radius of the outer circle in the RAM 103. Then, in stepS209, the control unit 101 draws at least a portion of a torus (partialtorus) on the image data 501 displayed in the image display area 401,based on the central point 620 and the radius of the outer circle. Aninitial value of the radius of the inner circle of the torus is lessthan the radius of the outer circle by a predetermined value (e.g., 20pixels). Further, start-point and end-point angles of the partial torusare also drawn using predetermined initial values. In the presentexemplary embodiment, a central line 611 is a line that passes throughthe central point 620 in the vertical direction in the image displayarea 401, and the clockwise direction from the central line 611 ispositive angles whereas the anti-clockwise direction from the centralline 611 is negative angles. For example, the initial value of thestart-point angle is −140 degrees from the central line 611, and theinitial value of the end-point angle is an increment angle of +280degrees from the start-point angle. Thus, the partial torus is drawnusing these initial values. As the user operates the pointing device tomove the cursor 629 on an inner-circle arc 622, the radius of the innercircle is changed (YES in step S210). In step S211, the control unit 101stores the value of distance from the end position of the movement ofthe cursor 629 to the central point 620 as the radius of the innercircle in the RAM 103, and in step S212, the control unit 101 redrawsand displays the inner-circle arc 622. In step S212, if the cursor 629on the outer-circle arc 621 is moved, the radius of the outer circle ischanged, and a value that is less than the radius of the outer circle bya predetermined value (e.g., 1 pixel) is stored as the radius of theinner circle in the RAM 103.

As the user operates the pointing device to move the cursor 629 on astart side 623 of the partial torus, the start-point angle is changed(YES in step S213). Thus, in step S214, the control unit 101 stores theangle between the line segment connecting the end position of themovement of the cursor 629 and the central point 620 and the centralline 611 as the start-point angle in the RAM 103, and in step S215, thecontrol unit 101 moves the start side 623 to redraw and display thepartial torus. If the end position of the movement of the cursor 629 tochange the start-point angle is a position beyond an end side 624, anangle obtained by adding −220 degrees to the central line 611 is storedin the RAM 103 as the start-point angle. Further, the control unit 101may control such that the movement of the cursor 629 to change thestart-point angle is allowed to be only within a position not beyond theend side 624, and is not allowed to go beyond the end side 624.

As the user operates the pointing device to move the cursor 629 on theend side 624 of the partial torus, the end-point angle is changed (YESin step S216). Thus, in step S217, the control unit 101 stores the anglebetween the start side 623 of the partial torus and the line segmentconnecting end position of the movement of the cursor 629 and thecentral point 620 as an increment angle (end-point angle) from thestart-point angle in the RAM 103. Then, in step S218, the control unit101 moves the end side 624 to redraw and display the partial torus. Ifthe end position of the movement of the cursor 629 to change theend-point angle is a position beyond the start side 623, an angleobtained by adding +360 degrees to the start-point angle is stored asthe end-point angle in the RAM 103. Further, the control unit 101 mayperform control in such a manner that the movement of the cursor 629 tochange the end-point angle is only allowed to be up to the start side623, and is not allowed to go beyond the start side 623.

In step S301, in response to the user operation, the control unit 101reads, from the RAM 103, the coordinates of the central point 620 of thetorus, the start-point and end-point angles of the torus as informationabout an edge detection area 700, and in step S302, the control unit 101calculates the start-point and end-point angles of the analogmeter 114.The start-point angle of the analogmeter 114 is a value obtained byadding a predetermined value (e.g., 2 degrees) to the start-point angleof the edge detection area 700, and the end-point angle of theanalogmeter 114 is a value obtained by subtracting a predetermined value(e.g., 4 degrees) from the end-point angle of the edge detection area700, and the values are calculated such that the start-point andend-point angles are located within the edge detection area 700. Thecalculated values are displayed as the initial values in the sections ofa minimum value angle 701 and a maximum value angle 702, respectively,in FIG. 7. Further, a line segment 711 which forms the minimum valueangle 701 from the central line 611, and a line segment 712 which formsthe maximum value angle 702 from the central line 611 are displayed onthe image data 501. The user operates the input device 106 to input avalue to the minimum value angle 701 and the maximum value angle 702 ormove the line segments 711 or 712, whereby the start-point and end-pointangles of the analogmeter 114 are changed, and the values stored in theRAM 103 are updated.

Then, in step S303, the control unit 101 performs edge detectionprocessing in the edge detection area 700 according to the values inputto an edge direction 703 and an edge intensity threshold value 704, andstores the coordinates specifying an edge portion in the RAM 103. In thepresent exemplary embodiment, Laplacian filter processing is applied tothe image data 501 converted into gray-scale data, and an edge portionsearch is performed from the start side 623 toward the end side 624 ofthe edge detection area 700 in the image having undergone the Laplacianfilter processing.

In the present exemplary embodiment, one of “light to dark”, “dark tolight”, and “both light to dark and dark to light” is set to the edgedirection 703. The edge intensity threshold value 704 is a thresholdvalue for the difference between adjacent pixel values to be detected asan edge portion. The greater the difference between the adjacent pixelvalues, the greater the difference in gradation and the higher the edgeintensity. For example, if 30 is designated as the edge intensitythreshold value 704 by a user operation, the control unit 101 detects aportion where the difference between the pixel values of adjacent pixelsis 30 or more, as an edge portion candidate. If “light to dark” is setto the edge direction 703, the control unit 101 compares the values ofadjacent pixels of the detected edge portion candidate and determines aportion where the pixel values change from high to low values as an edgeportion. In the case in which “dark to light” is set to the edgedirection 703, the control unit 101 compares the values of adjacentpixels of the detected edge portion candidate and determines a portionwhere the pixel values change from low to high values as an edgeportion. In the case in which “both light to dark and dark to light” isset to the edge direction 703, the control unit 101 determines the edgeportion candidate as an edge portion regardless of the direction ofchanges in the pixel values.

In step S304, the control unit 101 determines whether the number ofdetermined edge portions is equal to a preset number. In the presentexemplary embodiment, for example, 2 is preset as the number of the endsof a pointer 730. In the cases in which the pointer 730 includes adecoration line or the like, a number that is more than two is preset.Further, in the case in which pixels of an edge portion are adjacent toeach other, the edge portion is counted as one edge composed ofcontinuous pixels.

If the number of determined edge portions is not equal to the presentnumber (NO in step S304), then in step S305, a warning dialog indicatingthat an edge other than the pointer 730 is detected, is displayed. Forexample, an edge portion of an unnecessary object other than the pointer730 may be erroneously detected due to the presence of a foreign mattersuch as dirt and dust attached to the analogmeter 114.

On the other hand, if the number of determined edge portions is equal tothe present number (YES in step S304), then in step S306, the controlunit 101 draws and displays a first auxiliary line 728 indicating theclosest edge portion to the start side 623 on the image data 501. Next,the control unit 101 draws and displays a second auxiliary line 725 onthe image data 501 as a line segment that passes through the tip of thepointer 730. The second auxiliary line 725 forms an angle of a pointerwidth correction angle 705 against the line that connects anintersection point 729 of the first auxiliary line 728 and theouter-circle arc 621 and the central point 620.

After the user checks the first auxiliary line 728 and the secondauxiliary line 725 drawn on the image data 501, the user may operate theinput device 106 to move the first auxiliary line 728 and/or the secondauxiliary line 725. In this way, the user can correct the positions ofthe edge portion and the tip portion of the pointer 730, and change thevalue of the pointer width correction angle 705. Further, the value ofthe pointer width correction angle 705 can directly be corrected. If thecontrol unit 101 detects an operation to correct the pointer widthcorrection angle 705 (YES in step S307), then in step S308, the controlunit 101 stores the value of the pointer width correction angle 705 inthe RAM 103. In step S309, the control unit 101 redraws and displays thefirst auxiliary line 728 and/or the second auxiliary line 725.

In step S310, the control unit 101 inputs a minimum value 721 and amaximum value 722 of the analogmeter 114 in response to a useroperation. Alternatively, the control unit 101 may execute textrecognition processing on the image data 501 and automatically acquireand input the minimum value 721 and the maximum value 722.

In step S311, the control unit 101 sets a measurement value condition(notification value condition 723) for notification in response to auser operation. In the case of operating in the operation mode, thecontrol unit 101 performs notification if the pointer 730 of theanalogmeter 114 specifies a value outside or within a predeterminedvalue range.

Finally, if the control unit 101 receives a user operation on an endbutton 731 (YES in step S312), the control unit 101 ends the operationsin the setting mode. Alternatively, the end of the operations in thesetting mode may be followed by a start of the operations in theoperation mode, and a screen (not illustrated) of the operation mode canbe displayed on the display 104 in place of the analogmeter settingscreen 400.

<Processing in Operation Mode>

Next, a process performed when the image processing apparatus 100 in thepresent exemplary embodiment operates in the operation mode will bedescribed below with reference to the drawings.

The control unit 101 of the image processing apparatus 100 reads andstarts the application program from the HDD 105 for executinganalogmeter reading processing. The control unit 101 executes operationsdescribed below according to the OS and the application program.

When the application program is activated, the control unit 101 performsdisplay control to display the menu screen on the display 104 andselects one of the setting mode and the operation mode according to auser operation.

The operations of the image processing apparatus 100 in the case wherethe operation mode is selected will be described below with reference tothe flowchart illustrated in FIG. 8.

In step S801, the image processing apparatus 100 is connected with theimaging apparatus 112 via the network interface 108, and the controlunit 101 transmits an image capturing instruction to the imagingapparatus 112, and acquires an image captured by the image capturingfrom the imaging apparatus 112, and stores the image in the HDD 105. Theimaging apparatus 112 captures the image of the analogmeter 114 at thesame position as the position at which the image is acquired in stepS202 in the setting mode. The imaging apparatus 112 may perform imagecapturing processing and periodically transmit the images to the imageprocessing apparatus 100 or continuously distribute the images bystreaming. Alternatively, the image processing apparatus 100 canperiodically transmit an image capturing instruction, and the imagingapparatus 112 can periodically perform image capturing in response tothe image capturing instruction and transmit an image to the imageprocessing apparatus 100.

In step S802, the control unit 101 converts the image acquired from theimaging apparatus 112 into a gray-scale image and displays thegray-scale image on the screen. Alternatively, the imaging apparatus 112may convert the image into a gray-scale image and the image processingapparatus 100 receives the converted image.

In step S803, the control unit 101 applies the Laplacian filter to theconverted gray-scale image data and performs edge detection processingon the edge detection area 700 in the image to which the Laplacianfilter is applied, as in step S303. In step S804, the control unit 101determines whether the number of detected edge portions is equal to thepreset number, as in step S304. If the number of detected edge portionsis not equal to the preset number (NO in step S804), then in step S805,the warning dialog indicating that an edge other than the pointer 730 isdetected, is displayed. On the other hand, if the number of detectededge portions is equal to the preset number (YES in step S804), then instep S806, the control unit 101 calculates a line that connects theintersection point of the closest edge to the start side of the edgedetection area 700 and the outer-circle arc of the edge detection area700 and the central point 620 of the analogmeter 114. In step S807, thecontrol unit 101 identifies the tip of the pointer 730 on the line thatforms an angle of the pointer width correction angle 705 with respect tothe line calculated in step 5806, and stores the corrected angle in theRAM 103.

In step S808, the control unit 101 calculates the value pointed by thepointer 730 and stores the calculated value in the HDD 105. Thecalculated value is stored in association with attribute informationsuch as measurement time/date in the HDD 105.

The calculation processing in step S808 will be described below withreference to the conceptual diagram of the analogmeter 114 in FIG. 9. Aminimum angle (degMin) 901 is an angle set to the minimum value angle701 from the central line 611. A maximum angle (degInc) 902 is an angleobtained by adding the maximum value angle 702 to the minimum angle 901.A pointer angle (degEdge) 903 is an angle from the minimum angle 901 tothe edge of the pointer 730. A pointer width correction angle value(degWN) 904 is an angle set to the pointer width correction angle 705.

A calculation formula for a value valNeedle indicated by the pointer 730is expressed by formula (1) below

valNeedle=(degWN+degEdge)×(valMax−valMin)/degInc+valMin   (1),

where valMin is the value set to the minimum value 721, and valMax isthe value set to the maximum value 722.

When the pointer angle degEdge 903 is 43 degrees, the pointer widthcorrection angle value degWN 904 is 2 degrees, the maximum angle degInc902 is 270 degrees, the minimum value valMin is 0, and the maximum valuevalMax is 6, the value of valNeedle is 1.

When the pointer angle degEdge 903 is 205 degrees, the pointer widthcorrection angle value degWN 904 is 5 degrees, the maximum angle degInc902 is 270 degrees, the minimum value valMin is 0, and the maximum valuevalMax is 6, the value of valNeedle is 4.44 when the number ofsignificant figures is to the second decimal place.

In step S809, the control unit 101 determines whether the valuecalculated in step S808 satisfies the notification value condition 723.If the control unit 101 determines that the value calculated in stepS808 satisfies the notification value condition 723 (YES in step S809),then in step S810, the control unit 101 performs notification. Forexample, the control unit 101 displays the warning dialog on the display104. Further, an instruction as to whether to continue the operationmode may be received according to an operation on the warning dialog.Further, the warning dialog may be displayed on the image data. The edgedetection area 700, the edge detection position, an auxiliary line 725that passes through the tip of the pointer 730, etc. may also bedisplayed on the image data.

Then, if the control unit 101 receives an operation to end theprocessing (YES in step S811), the control unit 101 ends the operationsin the operation mode.

As described above, in the setting mode, the image processing apparatus100 in the present exemplary embodiment acquires the image of theanalogmeter 114 from the imaging apparatus 112 and presets the values ofthe scale and the pointer 730. Then, in the operation mode, the imageprocessing apparatus 100 acquires the image of the analogmeter 114 fromthe imaging apparatus 112, detects the pointer 730 according to thepreset values, and calculates the value indicated by the pointer 730.Then, the image processing apparatus 100 records the calculated valueindicated by the pointer 730 in the HDD 105, and performs notificationif the predetermined condition is satisfied.

In the present exemplary embodiment, in the operation mode, the controlunit 101 issues the warning dialog if the number of edges detected inthe edge detection area 700 is not equal to the predetermined value instep S805. For further improvement of the reliability, edges may bedetected from both the start-point and end-point directions, and thecontrol unit 101 determine whether the angle formed by the linesconnecting the respective edges and the central point 620 isapproximately twice the pointer width correction angle 705. A warning oferroneous detection may be issued if the angle is not approximatelytwice the pointer width correction angle 705.

In the present exemplary embodiment, in the operation mode, the controlunit 101 displays the warning dialog to stop measurement if the numberof edges detected in the edge detection area is not equal to thepredetermined value. The control unit 101 may issue a notification thatthe reliability of the calculated value is low, and continue themeasurement.

Further, in the operation mode, the control unit 101 may set a new edgedetection area on the central line based on the edges detected in theedge detection area 700 to improve the accuracy of edge detection. FIG.15 is a diagram illustrating the concept of setting a new edge detectionarea on the central line on the analogmeter setting screen. The edgedetection area 700 in FIG. 15 is the same as illustrated in FIG. 7. Inthe cases where an edge (728 in FIG. 7) is detected in the edgedetection area 700 surrounded by curves 621 and 622 and straight lines623 and 624, a new pointer width area is set as an edge detection area1501 on the straight line connecting the edge (728 in FIG. 7) and thecentral point 620, and the edge detection is determined as beingcompleted if an edge is detected in the edge detection area 1501,whereby erroneous detection is avoided.

The processing of adding the edge detection area 1501 and executing edgedetection is performed in step S303. Further, the processing can beperformed in step S803 in combination with the method of avoidingerroneous edge detection using the pointer width correction angle.

In the present exemplary embodiment, the radius of the outer circle ofthe edge detection area 700 may be increased within the range where thenumber of values detected in the edge detection area 700 is equal to thepredetermined value in the setting mode. The larger the radius of theouter circle of the edge detection area 700 becomes, the more preciselythe changes in the angle of the pointer 730 are detected.

While the Laplacian filter is used in the edge detection processing inthe present exemplary embodiment, any other filter capable of detectinghigh-frequency components can be used. In the case where the filter sizeis large, the positions of the start side 623 and the end side 624 ofthe edge detection area 700 are extended with the pointer widthcorrection angle taken into consideration so that detection isexecutable even if the pointer 730 is located on the start side 623 orthe end side 624 of the edge detection area 700.

In the case where the minimum value angle 701 or the maximum value angle702 is located outside the edge detection area 700, the start side 623and the end side 624 of the edge detection area 700 are changed toinclude the angle in the edge detection area 700.

As described above, the user can adjust the edge detection area 700while checking the image of the analogmeter 114 that is captured by theimaging apparatus 112, this reduces detection of an unnecessary edgeoutside the edge detection area 700 and thus reduces the possibility oferroneous detection of the value of the pointer 730.

In the present exemplary embodiment, the width from the edge to the tipof the pointer 730 is adjustable using the pointer width correctionangle 705. This enables accurate calculation of the value indicated bythe pointer 730 regardless of the shape of the pointer 730 even in thecase where the shape of the pointer 730 is thick or thin.

In the present exemplary embodiment, the user can make an adjustment bya simple operation while checking the displayed edge detection area 700in the setting mode. Further, the settings may be changed during theoperation mode.

In the present exemplary embodiment, the number of edges detected in theedge detection area 700 is compared with the predetermined value, andthe warning dialog is issued if the number of edges detected in the edgedetection area 700 is different from the predetermined value. Thus, theuser receives a notification of the possibility of erroneous detectiondue to the presence of a foreign matter in the edge detection area 700.

In the present exemplary embodiment, the auxiliary lines aresuperimposed on the measurement target image based on settinginformation such as the edge detection area 700 and the edge detectionposition in the operation mode in the case where the measurement valuesatisfies the predetermined condition or the reliability of themeasurement value is low. This enables the user to check the situationwith ease.

In a second present exemplary embodiment, an image processing apparatuswill be described below that reads a measurement value according to apointer specifying a physical quantity such as a temperature, apressure, the number of rotations, a current, or a voltage in astick-shaped analogmeter (rectangular measuring instrument) in place ofthe circular analogmeter. Description of the configurations that aresimilar to those in the exemplary embodiment described above is omitted.

<Processing in Setting Mode>

First, a process performed when the image processing apparatus 100 inthe second present exemplary embodiment operates in the setting modewill be described below with reference to FIGS. 11, 12, and 13.

The control unit 101 of the image processing apparatus 100 reads anapplication program for executing analogmeter reading processing fromthe HDD 105 and starts the application program. The control unit 101executes operations described below according to the OS and theapplication program. Then, the control unit 101 executes similarprocessing to steps 5201 to 5203 in FIG. 2, and displays an analogmetersetting screen 1000 on the display 104 as illustrated in FIG. 10.

If a drug start operation and an end operation of the pointing device(the input device 106) are performed on the image data 1001 displayed inthe image display area 401 (YES in step S1104), in step S1105, thecontrol unit 101 stores the coordinates of the respective positions(1301, 1302) as the opposite vertexes of a rectangular area in the RAM103. Then, in step S1106, the control unit 101 draws a rectangular areaand displays the drawn rectangular area as an edge detection area 1004.

In step S1201, the control unit 101 reads the coordinates of thevertexes as information about the edge detection area 1004 from the RAM103 in response to a user operation. In step S1202, a value obtained bysubtracting a predetermined value from the Y-coordinate of the startpoint 1301 of the edge detection area 1004, and a value obtained byadding a predetermined value to the Y-coordinate of the end point 1302are respectively calculated as the start-point and end-point coordinatesof the analogmeter 114. Specifically, the edge detection area 1004 isadjusted and set to include the start and end points of the analogmeter114. The predetermined values are, for example, 2 pixels. Further, thepredetermined values can be different. In the second present exemplaryembodiment, the coordinates are specified by values with the origin setto the upper left of the image data 1001 displayed in the image displayarea 401.

In step S1203, the control unit 101 performs edge detection processingon the edge detection area 1004 according to the values respectivelyinput to the edge direction 703 and the edge intensity threshold value704, and stores the coordinates specifying the edge portion in the RAM103, as in step S303. In step S1204, the control unit 101 determineswhether the number of determined edge portions is equal to the presetnumber, as in step S304. In the second present exemplary embodiment, thepredetermined value is set to 1. While the predetermined value is set to1 in the second present exemplary embodiment, the user can designate anyvalue as the predetermined value. This enables measurement even in thecase where the pointer is composed of a plurality of lines.

If the number of determined edge portion is equal to the preset number(YES in step S1204), the Y coordinate of the position of the horizontalline via the determined edge point is calculated as an initial value ofthe coordinates of a pointer 1005, then in step S1206, the control unit101 displays the auxiliary lines on the image data 1001. Specifically,an auxiliary line 1321 is displayed which indicates a rectangle havingthe start point 1301 and the end point 1302 as the opposite vertexes asthe edge detection area 1004. Further, an auxiliary line 1323 indicatingthe start point of the edge detection area 1004 and an auxiliary line1324 indicating the end point of the edge detection area 1004, both ofwhich auxiliary lines are acquired in step S1201, and an auxiliary line1326 indicating the start point of the analogmeter 114 and an auxiliaryline 1327 indicating the end point of the analogmeter 114 are displayed.Also, the auxiliary line 1325 indicating the position of the pointer1005 calculated in step S1205 is drawn. In the case where a pointerwidth correction coordinate 1331 is set, the coordinates of the positionof the pointer 1005 are corrected to reflect the value of the pointerwidth correction coordinate, the corrected coordinates are stored in theRAM 103, and the auxiliary line 1325 is moved and displayed.

Further, in step S1207, the control unit 101 sets and displays thevalues respectively corresponding to the coordinates of the start andend points of the analogmeter 114 with respect to a minimum valuecoordinate 1332 and a maximum value coordinate 1333.

In step S1208, the control unit 101 sets the notification valuecondition 723 for notification in response to a user operation. In thecase of operating in the operation mode, the control unit 101 performsnotification if the pointer 1005 of the analogmeter 114 specifies avalue outside a predetermined value range or within a predeterminedvalue range.

If the control unit 101 receives a user operation on the end button 731(YES in step S312), the control unit 101 ends the operations in thesetting mode. Alternatively, the end of the operations in the settingmode may be followed by a start of the operation mode, and a screen (notillustrated) of the operation mode may be displayed on the display 104in place of the analogmeter setting screen 1000.

<Processing in Operation Mode>

Next, a process performed when the image processing apparatus 100 in thesecond present exemplary embodiment operates in the operation mode willbe described below with reference to the drawings. The control unit 101of the image processing apparatus 100 loads the application program forexecuting analogmeter reading processing from the HDD 105 and starts theapplication program. The control unit 101 executes operations describedbelow according to the OS and the application program. Description ofoperations and configurations that are similar to those in the firstexemplary embodiment is omitted.

The operations of the image processing apparatus 100 in the secondpresent exemplary embodiment in the case where the operation mode isselected will be described below with reference to the flowchart in FIG.14. The control unit 101 executes similar processing to steps S801 toS805 in FIG. 8. In the second present exemplary embodiment, 1 is presetas the number of edges that is compared in step S804. Then, in stepS1406, the control unit 101 acquires the Y-coordinate of the edgeportion detected in step S803 as the coordinate of the pointer 1005, andin step S1407, the value set to the pointer width correction coordinate1331 is subtracted, and the pointer coordinates are updated and storedin the RAM 103.

In step S1408, the control unit 101 calculates the value indicated bythe pointer 1005 and stores the calculated value in the HDD 105. Thecalculated value is stored in association with attribute informationsuch as measurement time/date in the HDD 105. The following describesthe calculation processing in step S1408. A calculation formula for avalue valNeedle indicated by the pointer 1005 is expressed by formula(2) below

valNeedle=((yEdge−yWN)−yMin)×(valMax−valMin)/(yMax−yMin)+valMin   (2),

where yMin is the minimum value coordinate 1332, yMax is the maximumvalue coordinate 1333, yEdge is the coordinate of the pointer 1005, yWNis the pointer width correction coordinate, valMin is a minimum value1334, and valMax is a maximum value 1335.

For example, when the coordinate yEdge of the pointer 1005 is 350, thepointer width correction coordinate degWN is 0, the minimum valuecoordinate yMin is 820, the maximum value coordinate yMax is 20, theminimum value valMin is 0, and the maximum value valMax is 8, valNeedleis 4.7. When the coordinate yEdge of the pointer 1005 is 642, thepointer width correction coordinate degWN is 2, the minimum valuecoordinate yMin is 1240, the maximum value coordinate yMax is 40, theminimum value valMin is 0, and the maximum value valMax is 12, valNeedleis 6.

Then, the control unit 101 executes similar processing to steps S809 toS811.

As described above, the image processing apparatus in the presentexemplary embodiments enable the user to read the value indicated by thepointer with a simple setting even in the case where the measurementtarget analogmeter is in the shape of a stick.

The present exemplary embodiments make it possible to obtain a valueindicated by a pointer regardless of the shape of the pointer of theanalogmeter.

Other Embodiments

Embodiments of the disclosure can also be implemented by a computer of asystem or apparatus that reads out and executes computer executableinstructions (e.g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiments and/or that includes one or morecircuits (e.g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiments, and by a method performed by the computer of the system orapparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiments and/or controlling theone or more circuits to perform the functions of one or more of theabove-described embodiments. The computer may comprise one or moreprocessors (e.g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the disclosure has been described with reference to exemplaryembodiments, it is to be understood that the invention is not limited tothe disclosed exemplary embodiments. The scope of the following claimsis to be accorded the broadest interpretation so as to encompass allsuch modifications and equivalent structures and functions.

This application claims the benefit of Japanese Patent Applications No.2018-201268, filed Oct. 25, 2018, and No. 2017-221612, filed Nov. 17,2017, which are hereby incorporated by reference herein in theirentirety.

What is claimed is:
 1. An apparatus comprising: an acquisition unitconfigured to acquire an image of a measuring instrument that iscaptured by an imaging apparatus; a first setting unit configured to setan area in the image as an edge detection processing target in responseto a user operation; a detection unit configured to execute edgedetection processing on the set area in the image; a second setting unitconfigured to set a value for correcting a position of a detected edgeportion; a correction unit configured to correct the position of thedetected edge portion based on the value; and a calculation unitconfigured to calculate a value indicated by a pointer of the measuringinstrument according to the corrected position of the detected edgeportion.
 2. The apparatus according to claim 1, wherein the area is atleast a portion of a torus, and the setting unit sets at least one of acenter of the torus, a start side of the torus, an end side of thetorus, a radius of an outer circle of the torus, and a radius of aninner circle of the torus.
 3. The apparatus according to claim 2,wherein the position of the edge portion is indicated by an angle, andthe calculation unit calculates the value indicated by the pointer ofthe measuring instrument based on an angle of a minimum value that themeasuring instrument indicates, an angle of a maximum value that themeasuring instrument indicates, and the angle of the edge portion. 4.The apparatus according to claim 1, wherein the area is a rectangle, andthe setting unit sets opposite vertexes of the rectangle.
 5. Theapparatus according to claim 4, wherein the position of the edge portionis specified by a Y-coordinate, and the calculation unit calculates thevalue indicated by the pointer of the measuring instrument based on aY-coordinate of a minimum value that the measuring instrument indicates,a Y-coordinate of a maximum value that the measuring instrumentindicates, and the Y-coordinate of the edge portion.
 6. The apparatusaccording to claim 1, further comprising: a third setting unitconfigured to preset a number of edge portions to be detected; and anotification unit configured to issue notification if a number ofdetected edge portions is not equal to the preset number.
 7. Theapparatus according to claim 6, further comprising a changing unitconfigured to change the area within a range where the number ofdetected edge portions is equal to the preset number.
 8. A method ofcontrolling an apparatus comprising: acquiring an image of a measuringinstrument that is captured by an imaging apparatus; setting an area inthe image as an edge detection processing target in response to a useroperation; executing edge detection processing on the set area in theimage; setting a value for correcting a position of a detected edgeportion; correcting the position of the detected edge portion based onthe value; and calculating a value indicated by a pointer of themeasuring instrument according to the corrected position of the edgeportion.
 9. The method according to claim 8, wherein the area is atleast a portion of a torus, and the setting sets at least one of acenter of the torus, a start side of the torus, an end side of thetorus, a radius of an outer circle of the torus, and a radius of aninner circle of the torus.
 10. The method according to claim 9, whereinthe position of the edge portion is indicated by an angle, and thecalculating calculates the value indicated by the pointer of themeasuring instrument based on an angle of a minimum value that themeasuring instrument indicates, an angle of a maximum value that themeasuring instrument indicates, and the angle of the edge portion. 11.The method according to claim 8, wherein the area is a rectangle, andthe setting sets opposite vertexes of the rectangle.
 12. The methodaccording to claim 11, wherein the position of the edge portion isspecified by a Y-coordinate, and the calculating calculates the valueindicated by the pointer of the measuring instrument based on aY-coordinate of a minimum value that the measuring instrument indicates,a Y-coordinate of a maximum value that the measuring instrumentindicates, and the Y-coordinate of the edge portion.
 13. The methodaccording to claim 8, further comprising: presetting a number of edgeportions to be detected; and issuing notification if a number ofdetected edge portions is not equal to the preset number.
 14. The methodaccording to claim 13, further comprising changing the area within arange where the number of detected edge portions is equal to the presetnumber.
 15. A non-transitory computer-readable storage medium storing aprogram of instructions for causing a computer to perform a methodcomprising: acquiring an image of a measuring instrument that iscaptured by an imaging apparatus; setting an area in the image as anedge detection processing target in response to a user operation;executing edge detection processing on the set area in the image;setting a value for correcting a position of a detected edge portion;correcting the position of the detected edge portion based on the value;and calculating a value indicated by a pointer of the measuringinstrument according to the corrected position of the edge portion. 16.The non-transitory computer-readable storage medium according to claim15, wherein the area is at least a portion of a torus, and the settingsets at least one of a center of the torus, a start side of the torus,an end side of the torus, a radius of an outer circle of the torus, anda radius of an inner circle of the torus.
 17. The non-transitorycomputer-readable storage medium according to claim 16, wherein theposition of the edge portion is indicated by an angle, and thecalculating calculates the value indicated by the pointer of themeasuring instrument based on an angle of a minimum value that themeasuring instrument indicates, an angle of a maximum value that themeasuring instrument indicates, and the angle of the edge portion. 18.The non-transitory computer-readable storage medium according to claim15, wherein the area is a rectangle, and the setting sets oppositevertexes of the rectangle.
 19. The non-transitory computer-readablestorage medium according to claim 15, further comprising: presetting anumber of edge portions to be detected; and issuing notification if anumber of detected edge portions is not equal to the preset number. 20.The non-transitory computer-readable storage medium according to claim19, further comprising changing the area within a range where the numberof detected edge portions is equal to the preset number.